object RelCartaComissaoGuias: TRelCartaComissaoGuias
  Left = 192
  Top = 107
  Width = 870
  Height = 500
  Caption = 'RelCartaComissaoGuias'
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = False
  PixelsPerInch = 96
  TextHeight = 13
  object rlRelatorio: TRLReport
    Left = 0
    Top = -2
    Width = 794
    Height = 1123
    DataSource = dsConsulta
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clBlack
    Font.Height = -9
    Font.Name = 'Arial'
    Font.Style = []
    Margins.LeftMargin = 6.000000000000000000
    Margins.TopMargin = 8.000000000000000000
    Margins.RightMargin = 6.000000000000000000
    PrintEmpty = False
    Title = 'Carta de comiss'#227'o'
    object RLGroup1: TRLGroup
      Left = 23
      Top = 30
      Width = 748
      Height = 1067
      DataFields = 'GRUPO_CODIGO'
      object RLSubDetail2: TRLSubDetail
        Left = 0
        Top = 154
        Width = 748
        Height = 62
        DataSource = dsPostos
        object RLBand2: TRLBand
          Left = 0
          Top = 0
          Width = 748
          Height = 16
          Borders.Sides = sdCustom
          Borders.DrawLeft = False
          Borders.DrawTop = False
          Borders.DrawRight = False
          Borders.DrawBottom = True
          object RLDraw40: TRLDraw
            Left = 636
            Top = 0
            Width = 1
            Height = 15
            Align = faBottomOnly
            Angle = 90.000000000000000000
            DrawKind = dkLine
          end
          object RLDraw42: TRLDraw
            Left = 747
            Top = 0
            Width = 1
            Height = 15
            Align = faRightBottom
            Angle = 90.000000000000000000
            DrawKind = dkLine
          end
          object RLDraw43: TRLDraw
            Left = 0
            Top = 0
            Width = 1
            Height = 15
            Align = faLeftBottom
            Angle = 90.000000000000000000
            DrawKind = dkLine
          end
          object RLDBText8: TRLDBText
            Left = 2
            Top = 1
            Width = 43
            Height = 10
            DataField = 'FRANQUIA'
            DataSource = dsPostos
            Font.Charset = DEFAULT_CHARSET
            Font.Color = clBlack
            Font.Height = -8
            Font.Name = 'Arial'
            Font.Style = []
            ParentFont = False
          end
          object RLDBText25: TRLDBText
            Left = 640
            Top = 1
            Width = 105
            Height = 13
            Alignment = taRightJustify
            AutoSize = False
            DataField = 'VALGUIAS'
            DataSource = dsPostos
            DisplayMask = '###,###,##0.00'
            Font.Charset = DEFAULT_CHARSET
            Font.Color = clBlack
            Font.Height = -8
            Font.Name = 'Arial'
            Font.Style = []
            ParentFont = False
          end
          object RLDBText26: TRLDBText
            Left = 577
            Top = 1
            Width = 56
            Height = 13
            Alignment = taRightJustify
            AutoSize = False
            DataField = 'MEDIA'
            DataSource = dsPostos
            DisplayMask = '###,###,##0.00'
            Font.Charset = DEFAULT_CHARSET
            Font.Color = clBlack
            Font.Height = -8
            Font.Name = 'Arial'
            Font.Style = []
            ParentFont = False
          end
          object RLDBText27: TRLDBText
            Left = 524
            Top = 1
            Width = 45
            Height = 13
            Alignment = taRightJustify
            AutoSize = False
            DataField = 'GUIAS'
            DataSource = dsPostos
            DisplayMask = '###,##0'
            Font.Charset = DEFAULT_CHARSET
            Font.Color = clBlack
            Font.Height = -8
            Font.Name = 'Arial'
            Font.Style = []
            ParentFont = False
          end
          object RLDraw54: TRLDraw
            Left = 520
            Top = 0
            Width = 1
            Height = 15
            Align = faBottomOnly
            Angle = 90.000000000000000000
            DrawKind = dkLine
          end
          object RLDraw1: TRLDraw
            Left = 573
            Top = 0
            Width = 1
            Height = 15
            Align = faBottomOnly
            Angle = 90.000000000000000000
            DrawKind = dkLine
          end
        end
        object RLBand3: TRLBand
          Left = 0
          Top = 16
          Width = 748
          Height = 46
          BandType = btColumnFooter
          Borders.Sides = sdCustom
          Borders.DrawLeft = False
          Borders.DrawTop = False
          Borders.DrawRight = False
          Borders.DrawBottom = False
          object RLDraw61: TRLDraw
            Left = 520
            Top = 0
            Width = 1
            Height = 15
            Align = faTopOnly
            Angle = 90.000000000000000000
            DrawKind = dkLine
          end
          object RLDraw63: TRLDraw
            Left = 636
            Top = 0
            Width = 1
            Height = 15
            Align = faTopOnly
            Angle = 90.000000000000000000
            DrawKind = dkLine
          end
          object RLDraw64: TRLDraw
            Left = 636
            Top = 15
            Width = 1
            Height = 31
            Align = faBottomOnly
            Angle = 90.000000000000000000
            DrawKind = dkLine
          end
          object RLLabel21: TRLLabel
            Left = 3
            Top = 2
            Width = 23
            Height = 10
            Caption = 'Totais'
            Font.Charset = DEFAULT_CHARSET
            Font.Color = clBlack
            Font.Height = -8
            Font.Name = 'Arial'
            Font.Style = []
            ParentFont = False
          end
          object RLDBResult15: TRLDBResult
            Left = 525
            Top = 2
            Width = 44
            Height = 12
            Alignment = taRightJustify
            AutoSize = False
            DataField = 'GUIAS'
            DataSource = dsPostos
            DisplayMask = '###,##0'
            Font.Charset = DEFAULT_CHARSET
            Font.Color = clBlack
            Font.Height = -8
            Font.Name = 'Arial'
            Font.Style = []
            Info = riSum
            ParentFont = False
          end
          object RLDBResult16: TRLDBResult
            Left = 578
            Top = 2
            Width = 55
            Height = 12
            Alignment = taRightJustify
            AutoSize = False
            DataField = 'MEDIA'
            DataSource = dsPostos
            DisplayMask = '###,###,##0.00'
            Font.Charset = DEFAULT_CHARSET
            Font.Color = clBlack
            Font.Height = -8
            Font.Name = 'Arial'
            Font.Style = []
            Info = riAverage
            ParentFont = False
          end
          object RLDBResult18: TRLDBResult
            Left = 640
            Top = 2
            Width = 105
            Height = 12
            Alignment = taRightJustify
            AutoSize = False
            DataField = 'VALGUIAS'
            DataSource = dsPostos
            DisplayMask = '###,###,##0.00'
            Font.Charset = DEFAULT_CHARSET
            Font.Color = clBlack
            Font.Height = -8
            Font.Name = 'Arial'
            Font.Style = []
            Info = riSum
            ParentFont = False
          end
          object RLDraw68: TRLDraw
            Left = 0
            Top = 15
            Width = 748
            Height = 1
            DrawKind = dkLine
          end
          object RLDBResult22: TRLDBResult
            Left = 640
            Top = 17
            Width = 105
            Height = 12
            Alignment = taRightJustify
            AutoSize = False
            DataFormula = 'VALGUIAS*COMISSAO_ISS/100'
            DataSource = dsPostos
            DisplayMask = '###,###,##0.00'
            Font.Charset = DEFAULT_CHARSET
            Font.Color = clBlack
            Font.Height = -8
            Font.Name = 'Arial'
            Font.Style = []
            Info = riSum
            ParentFont = False
            Visible = False
          end
          object resSubtotal: TRLDBResult
            Left = 640
            Top = 32
            Width = 105
            Height = 12
            Alignment = taRightJustify
            AutoSize = False
            DataFormula = 'VALGUIAS-(VALGUIAS*COMISSAO_ISS/100)'
            DataSource = dsPostos
            DisplayMask = '###,###,##0.00'
            Font.Charset = DEFAULT_CHARSET
            Font.Color = clBlack
            Font.Height = -8
            Font.Name = 'Arial'
            Font.Style = []
            Info = riSum
            ParentFont = False
          end
          object RLLabel24: TRLLabel
            Left = 576
            Top = 32
            Width = 56
            Height = 10
            Alignment = taRightJustify
            Caption = '(=) SUBTOTAL'
            Font.Charset = DEFAULT_CHARSET
            Font.Color = clBlack
            Font.Height = -8
            Font.Name = 'Arial'
            Font.Style = []
            ParentFont = False
          end
          object RLDraw69: TRLDraw
            Left = 0
            Top = 30
            Width = 748
            Height = 1
            Align = faRightOnly
            DrawKind = dkLine
            Visible = False
          end
          object RLDraw70: TRLDraw
            Left = 0
            Top = 44
            Width = 748
            Height = 1
            Align = faRightOnly
            DrawKind = dkLine
          end
          object RLDBText36: TRLDBText
            Left = 424
            Top = 17
            Width = 209
            Height = 13
            Alignment = taRightJustify
            AutoSize = False
            DataField = 'COMISSAO_ISS'
            DataSource = dsPostos
            Font.Charset = DEFAULT_CHARSET
            Font.Color = clBlack
            Font.Height = -8
            Font.Name = 'Arial'
            Font.Style = []
            ParentFont = False
            Text = '(-) desconto: '
            Visible = False
          end
          object RLDraw20: TRLDraw
            Left = 747
            Top = 1
            Width = 1
            Height = 45
            Align = faRightBottom
            Angle = 90.000000000000000000
            DrawKind = dkLine
          end
          object RLDraw23: TRLDraw
            Left = 0
            Top = 0
            Width = 1
            Height = 45
            Align = faLeftTop
            Angle = 90.000000000000000000
            DrawKind = dkLine
          end
          object RLDBText32: TRLDBText
            Left = 3
            Top = 18
            Width = 152
            Height = 10
            DataField = 'CARTA_CREDITO'
            DataSource = dsConsulta
            Font.Charset = DEFAULT_CHARSET
            Font.Color = clBlack
            Font.Height = -8
            Font.Name = 'Arial'
            Font.Style = []
            ParentFont = False
            Text = 'A ser creditado at'#233' o dia '
          end
          object RLDBText34: TRLDBText
            Left = 3
            Top = 31
            Width = 227
            Height = 10
            DataFormula = 'COMISSAO_CONTA+'#39' Titular: '#39'+COMISSAO_TITULAR'
            DataSource = dsConsulta
            Font.Charset = DEFAULT_CHARSET
            Font.Color = clBlack
            Font.Height = -8
            Font.Name = 'Arial'
            Font.Style = []
            ParentFont = False
            Text = 'Conta: '
          end
          object RLDBText23: TRLDBText
            Left = 166
            Top = 18
            Width = 188
            Height = 10
            DataFormula = 'BANCO+'#39' Ag'#234'ncia:'#39'+COMISSAO_AGENCIA'
            DataSource = dsConsulta
            Font.Charset = DEFAULT_CHARSET
            Font.Color = clBlack
            Font.Height = -8
            Font.Name = 'Arial'
            Font.Style = []
            ParentFont = False
            Text = 'Banco: '
          end
          object RLDBText24: TRLDBText
            Left = 299
            Top = 31
            Width = 87
            Height = 10
            DataFormula = 'GRUPO_TIPOCONTA'
            DataSource = dsConsulta
            Font.Charset = DEFAULT_CHARSET
            Font.Color = clBlack
            Font.Height = -8
            Font.Name = 'Arial'
            Font.Style = []
            ParentFont = False
          end
          object RLDraw62: TRLDraw
            Left = 573
            Top = 0
            Width = 1
            Height = 15
            Align = faTopOnly
            Angle = 90.000000000000000000
            DrawKind = dkLine
          end
        end
      end
      object RLSubDetail1: TRLSubDetail
        Left = 0
        Top = 216
        Width = 748
        Height = 18
        DataSource = dsAjustes
        object RLBand4: TRLBand
          Left = 0
          Top = 0
          Width = 748
          Height = 17
          object RLDraw74: TRLDraw
            Left = 0
            Top = 16
            Width = 748
            Height = 1
            Align = faRightOnly
            DrawKind = dkLine
          end
          object RLDBText30: TRLDBText
            Left = 424
            Top = 2
            Width = 209
            Height = 13
            Alignment = taRightJustify
            AutoSize = False
            DataField = 'AJUSTEGRUPO_DESCRICAO'
            DataSource = dsAjustes
            Font.Charset = DEFAULT_CHARSET
            Font.Color = clBlack
            Font.Height = -8
            Font.Name = 'Arial'
            Font.Style = []
            ParentFont = False
            Text = '(+/-) '
          end
          object rldAjuste: TRLDBText
            Left = 640
            Top = 1
            Width = 105
            Height = 13
            Alignment = taRightJustify
            AutoSize = False
            DataField = 'AJUSTECOMISSAO_VALOR'
            DataSource = dsAjustes
            Font.Charset = DEFAULT_CHARSET
            Font.Color = clBlack
            Font.Height = -8
            Font.Name = 'Arial'
            Font.Style = []
            ParentFont = False
          end
          object RLDraw10: TRLDraw
            Left = 0
            Top = 0
            Width = 1
            Height = 15
            Align = faLeftTop
            Angle = 90.000000000000000000
            DrawKind = dkLine
          end
          object RLDraw4: TRLDraw
            Left = 636
            Top = 0
            Width = 1
            Height = 15
            Align = faTopOnly
            Angle = 90.000000000000000000
            DrawKind = dkLine
          end
          object RLDraw3: TRLDraw
            Left = 0
            Top = 2
            Width = 1
            Height = 15
            Align = faLeftBottom
            Angle = 90.000000000000000000
            DrawKind = dkLine
          end
          object RLDraw13: TRLDraw
            Left = 747
            Top = 2
            Width = 1
            Height = 15
            Align = faRightBottom
            Angle = 90.000000000000000000
            DrawKind = dkLine
          end
        end
      end
      object rlband: TRLBand
        Left = 0
        Top = 234
        Width = 748
        Height = 808
        AutoExpand = False
        BandType = btColumnFooter
        Borders.Sides = sdCustom
        Borders.DrawLeft = False
        Borders.DrawTop = False
        Borders.DrawRight = False
        Borders.DrawBottom = False
        Borders.Style = bsVertical
        object RLDraw71: TRLDraw
          Left = 0
          Top = 0
          Width = 1
          Height = 20
          Align = faLeftTop
          Angle = 90.000000000000000000
          DrawKind = dkLine
        end
        object rlTexto: TRLRichText
          Left = 1
          Top = 80
          Width = 745
          Height = 18
          IntegralHeight = True
          WordWrap = False
        end
        object RLDraw11: TRLDraw
          Left = 0
          Top = 19
          Width = 748
          Height = 1
          Align = faRightOnly
          DrawKind = dkLine
        end
        object rlTotLiq: TRLLabel
          Left = 424
          Top = 2
          Width = 320
          Height = 14
          Alignment = taRightJustify
          AutoSize = False
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -12
          Font.Name = 'Arial'
          Font.Style = [fsBold]
          ParentFont = False
        end
        object rlObs: TRLRichText
          Left = 1
          Top = 24
          Width = 745
          Height = 18
          IntegralHeight = True
          WordWrap = False
        end
        object RLDraw5: TRLDraw
          Left = 0
          Top = 793
          Width = 1
          Height = 15
          Align = faLeftBottom
          Angle = 90.000000000000000000
          DrawKind = dkLine
        end
        object RLDraw12: TRLDraw
          Left = 747
          Top = 0
          Width = 1
          Height = 20
          Align = faRightTop
          Angle = 90.000000000000000000
          DrawKind = dkLine
        end
        object resGuias: TRLDBResult
          Left = 176
          Top = 2
          Width = 81
          Height = 12
          Alignment = taRightJustify
          AutoSize = False
          DataFormula = 'TOTALCRED-(TOTALCRED*COMISSAO_ISS/100)'
          DataSource = dsPostos
          DisplayMask = '###,###,##0.00'
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -8
          Font.Name = 'Arial'
          Font.Style = []
          Info = riSum
          ParentFont = False
          Visible = False
        end
        object resAjustes: TRLLabel
          Left = 336
          Top = 2
          Width = 8
          Height = 12
          Caption = '0'
          Visible = False
        end
      end
      object RLBand1: TRLBand
        Left = 0
        Top = 0
        Width = 748
        Height = 154
        AutoExpand = False
        Borders.Sides = sdCustom
        Borders.DrawLeft = False
        Borders.DrawTop = False
        Borders.DrawRight = False
        Borders.DrawBottom = True
        object RLLabel10: TRLLabel
          Left = 639
          Top = 141
          Width = 45
          Height = 12
          Align = faBottomOnly
          Caption = 'Comiss'#227'o'
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -9
          Font.Name = 'Arial'
          Font.Style = []
          ParentFont = False
        end
        object RLDBText1: TRLDBText
          Left = 535
          Top = 2
          Width = 101
          Height = 14
          Alignment = taRightJustify
          DataField = 'Impressao'
          DataSource = dsConsulta
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -11
          Font.Name = 'Arial'
          Font.Style = []
          ParentFont = False
          Text = 'Teresina, '
        end
        object RLDBText2: TRLDBText
          Left = 40
          Top = 24
          Width = 228
          Height = 18
          DataField = 'GRUPO_DESCRICAO'
          DataSource = dsConsulta
          Font.Charset = ANSI_CHARSET
          Font.Color = clBlack
          Font.Height = -13
          Font.Name = 'Arial Black'
          Font.Style = []
          ParentFont = False
          Text = 'COMISS'#195'O '
        end
        object RLDBText3: TRLDBText
          Left = 40
          Top = 62
          Width = 88
          Height = 14
          DataField = 'GRUPO_ATT'
          DataSource = dsConsulta
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -11
          Font.Name = 'Arial'
          Font.Style = []
          ParentFont = False
          Text = 'Att.: '
        end
        object rlLinha: TRLLabel
          Left = 4
          Top = 141
          Width = 27
          Height = 12
          Align = faBottomOnly
          Caption = 'Posto'
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -9
          Font.Name = 'Arial'
          Font.Style = []
          ParentFont = False
        end
        object RLDraw2: TRLDraw
          Left = 520
          Top = 138
          Width = 1
          Height = 15
          Align = faBottomOnly
          Angle = 90.000000000000000000
          DrawKind = dkLine
        end
        object RLDraw82: TRLDraw
          Left = 0
          Top = 137
          Width = 748
          Height = 1
          Align = faRightOnly
          DrawKind = dkLine
        end
        object RLMemo1: TRLMemo
          Left = 40
          Top = 98
          Width = 729
          Height = 29
          AutoSize = False
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -11
          Font.Name = 'Arial'
          Font.Style = []
          Lines.Strings = (
            
              'Informamos, com satisfa'#231#227'o, que estamos repassando a remunera'#231#227'o' +
              ' sobre as guias recebidas'
            
              'e os cr'#233'ditos digitais vendidos neste(s) posto(s) de recebimento' +
              ', conforme demonstrativo abaixo:')
          ParentFont = False
        end
        object RLLabel9: TRLLabel
          Left = 524
          Top = 141
          Width = 21
          Height = 12
          Align = faBottomOnly
          Caption = 'Qtd.'
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -9
          Font.Name = 'Arial'
          Font.Style = []
          ParentFont = False
        end
        object RLLabel23: TRLLabel
          Left = 576
          Top = 141
          Width = 55
          Height = 12
          Align = faBottomOnly
          Caption = 'Tarifa m'#233'dia'
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -9
          Font.Name = 'Arial'
          Font.Style = []
          ParentFont = False
        end
        object RLDBText4: TRLDBText
          Left = 40
          Top = 45
          Width = 150
          Height = 14
          DataField = 'COMISSAO_PERIODO'
          DataSource = dsConsulta
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -11
          Font.Name = 'Arial'
          Font.Style = [fsBold]
          ParentFont = False
          Text = 'Ref. a: '
        end
        object RLDraw6: TRLDraw
          Left = 573
          Top = 138
          Width = 1
          Height = 15
          Align = faBottomOnly
          Angle = 90.000000000000000000
          DrawKind = dkLine
        end
        object RLDraw7: TRLDraw
          Left = 636
          Top = 138
          Width = 1
          Height = 15
          Align = faBottomOnly
          Angle = 90.000000000000000000
          DrawKind = dkLine
        end
        object RLDraw8: TRLDraw
          Left = 0
          Top = 138
          Width = 1
          Height = 15
          Align = faLeftBottom
          Angle = 90.000000000000000000
          DrawKind = dkLine
        end
        object RLDraw9: TRLDraw
          Left = 747
          Top = 138
          Width = 1
          Height = 15
          Align = faRightBottom
          Angle = 90.000000000000000000
          DrawKind = dkLine
        end
        object resGarantia: TRLDBResult
          Left = 520
          Top = 42
          Width = 81
          Height = 12
          Alignment = taRightJustify
          AutoSize = False
          DataField = 'COMISSAO_GARANTIA'
          DataSource = dsPostos
          DisplayMask = '###,###,##0.00'
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -8
          Font.Name = 'Arial'
          Font.Style = []
          ParentFont = False
          Visible = False
        end
        object resNDepositar: TRLDBResult
          Left = 520
          Top = 58
          Width = 81
          Height = 12
          Alignment = taRightJustify
          AutoSize = False
          DataField = 'COMISSAO_NDEPOSITAR'
          DataSource = dsPostos
          DisplayMask = '###,###,##0.00'
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -8
          Font.Name = 'Arial'
          Font.Style = []
          ParentFont = False
          Visible = False
        end
      end
    end
  end
  object qryConsulta: TADOQuery
    Connection = FormPrincipal.cnRGT
    CursorType = ctStatic
    CommandTimeout = 90
    Parameters = <
      item
        Name = 'PERIODO'
        DataType = ftString
        NumericScale = 255
        Precision = 255
        Size = 5
        Value = 'MAR06'
      end>
    Prepared = True
    SQL.Strings = (
      'SELECT B.NOME AS BANCO, C.*, A.CARTA_DATAINI, A.CARTA_DATAFIM, '
      'CARTA_GERACAO, CARTA_CREDITO, CARTA_OBS, CARTA_AVISO, CARTA_PAGO'
      
        'FROM CARTA A INNER JOIN COMISSAO C ON (C.COMISSAO_PERIODO=A.COMI' +
        'SSAO_PERIODO)'
      'LEFT JOIN BANCOS B ON (B.CODIGO=C.COMISSAO_BANCO)'
      'WHERE A.COMISSAO_PERIODO=:PERIODO'
      'AND ((SELECT SUM(GUIAS)'
      'FROM FRANCOMISSAO F '
      'WHERE (F.GRUPO_CODIGO=C.GRUPO_CODIGO)'
      'AND (F.COMISSAO_PERIODO=C.COMISSAO_PERIODO))>0)'
      'ORDER BY C.GRUPO_CODIGO')
    Left = 266
    Top = 959
    object qryConsultaBANCO: TStringField
      FieldName = 'BANCO'
      Size = 50
    end
    object qryConsultaGRUPO_CODIGO: TIntegerField
      FieldName = 'GRUPO_CODIGO'
    end
    object qryConsultaCOMISSAO_PERIODO: TStringField
      FieldName = 'COMISSAO_PERIODO'
      EditMask = 'AAA\/99;0; '
      FixedChar = True
      Size = 5
    end
    object qryConsultaGRUPO_CREDIGI: TBCDField
      FieldName = 'GRUPO_CREDIGI'
      DisplayFormat = '##0.00%'
      Precision = 19
    end
    object qryConsultaCALGUIA_CODIGO: TIntegerField
      FieldName = 'CALGUIA_CODIGO'
    end
    object qryConsultaCOMISSAO_JUNTAR: TStringField
      FieldName = 'COMISSAO_JUNTAR'
      FixedChar = True
      Size = 1
    end
    object qryConsultaCOMISSAO_BANCO: TSmallintField
      FieldName = 'COMISSAO_BANCO'
    end
    object qryConsultaCOMISSAO_AGENCIA: TStringField
      FieldName = 'COMISSAO_AGENCIA'
      FixedChar = True
      Size = 8
    end
    object qryConsultaCOMISSAO_CONTA: TStringField
      FieldName = 'COMISSAO_CONTA'
      Size = 15
    end
    object qryConsultaCOMISSAO_TITULAR: TStringField
      FieldName = 'COMISSAO_TITULAR'
      Size = 50
    end
    object qryConsultaCOMISSAO_GARANTIA: TBCDField
      FieldName = 'COMISSAO_GARANTIA'
      Precision = 19
    end
    object qryConsultaCOMISSAO_ISS: TBCDField
      FieldName = 'COMISSAO_ISS'
      EditFormat = ' - ##0.00%'
      Precision = 19
    end
    object qryConsultaCOMISSAO_OBS: TMemoField
      FieldName = 'COMISSAO_OBS'
      BlobType = ftMemo
    end
    object qryConsultaGRUPO_ATT: TStringField
      FieldName = 'GRUPO_ATT'
      Size = 30
    end
    object qryConsultaGRUPO_DESCRICAO: TStringField
      FieldName = 'GRUPO_DESCRICAO'
      Size = 50
    end
    object qryConsultaGRUPO_TIPOCONTA: TStringField
      FieldName = 'GRUPO_TIPOCONTA'
      Size = 15
    end
    object qryConsultaGRUPO_OI: TBCDField
      FieldName = 'GRUPO_OI'
      DisplayFormat = '##0.00%'
      Precision = 19
    end
    object qryConsultaGRUPO_TIM: TBCDField
      FieldName = 'GRUPO_TIM'
      DisplayFormat = '##0.00%'
      Precision = 19
    end
    object qryConsultaCOMISSAO_AJUSTES: TBCDField
      FieldName = 'COMISSAO_AJUSTES'
      Precision = 19
    end
    object qryConsultaCARTA_DATAINI: TDateTimeField
      FieldName = 'CARTA_DATAINI'
    end
    object qryConsultaCARTA_DATAFIM: TDateTimeField
      FieldName = 'CARTA_DATAFIM'
    end
    object qryConsultaCARTA_GERACAO: TDateTimeField
      FieldName = 'CARTA_GERACAO'
    end
    object qryConsultaCARTA_CREDITO: TDateTimeField
      FieldName = 'CARTA_CREDITO'
    end
    object qryConsultaCARTA_OBS: TMemoField
      FieldName = 'CARTA_OBS'
      BlobType = ftFmtMemo
    end
    object qryConsultaCARTA_AVISO: TMemoField
      FieldName = 'CARTA_AVISO'
      BlobType = ftFmtMemo
    end
    object qryConsultaImpressao: TStringField
      FieldKind = fkCalculated
      FieldName = 'Impressao'
      Size = 50
      Calculated = True
    end
    object qryConsultaCOMISSAO_NDEPOSITAR: TStringField
      FieldName = 'COMISSAO_NDEPOSITAR'
      FixedChar = True
      Size = 1
    end
    object qryConsultaGRUPO_EMBRATELLDR: TBCDField
      FieldName = 'GRUPO_EMBRATELLDR'
      DisplayFormat = '##0.00%'
      Precision = 19
    end
    object qryConsultaGRUPO_EMBRATELLIVRE: TBCDField
      FieldName = 'GRUPO_EMBRATELLIVRE'
      DisplayFormat = '##0.00%'
      Precision = 19
    end
    object qryConsultaCOMISSAO_OIRECARGA: TBCDField
      FieldName = 'COMISSAO_OIRECARGA'
      Precision = 19
    end
  end
  object dsConsulta: TDataSource
    DataSet = qryConsulta
    Left = 266
    Top = 976
  end
  object dsPostos: TDataSource
    DataSet = qryPostos
    Left = 338
    Top = 951
  end
  object qryPostos: TADOQuery
    Connection = FormPrincipal.cnRGT
    CursorType = ctStatic
    CommandTimeout = 90
    DataSource = dsConsulta
    Parameters = <
      item
        Name = 'GRUPO_CODIGO'
        Attributes = [paSigned]
        DataType = ftInteger
        Precision = 10
        Size = 4
        Value = 4000
      end
      item
        Name = 'COMISSAO_PERIODO'
        DataType = ftString
        NumericScale = 255
        Precision = 255
        Size = 5
        Value = 'MAR06'
      end>
    Prepared = True
    SQL.Strings = (
      
        'SELECT MEDIA*GUIAS AS VALGUIAS, FC.*,  C.COMISSAO_NDEPOSITAR, C.' +
        'COMISSAO_AJUSTES,'
      
        'C.COMISSAO_GARANTIA, C.COMISSAO_ISS, A.CARTA_DATAINI, A.CARTA_DA' +
        'TAFIM,'
      
        'CARTA_GERACAO, CARTA_CREDITO, ISNULL(CARTA_OBS,'#39#39') as CARTA_OBS,' +
        ' CARTA_PAGO, '
      
        'CAST(F.CODIGO AS VARCHAR(10)) +'#39' - '#39'+F.NOME_FANTASIA AS FRANQUIA' +
        ' '
      
        'FROM CARTA A INNER JOIN COMISSAO C ON (C.COMISSAO_PERIODO=A.COMI' +
        'SSAO_PERIODO)'
      'INNER JOIN FRANCOMISSAO FC ON (FC.GRUPO_CODIGO=C.GRUPO_CODIGO)'
      'AND (FC.COMISSAO_PERIODO=C.COMISSAO_PERIODO)'
      'INNER JOIN FRANQUIA F ON (F.CODIGO=FC.FRANQUIA_CODIGO)'
      'WHERE (FC.GRUPO_CODIGO=:GRUPO_CODIGO) AND '
      ' (A.COMISSAO_PERIODO=:COMISSAO_PERIODO)  AND (GUIAS > 0)'
      'ORDER BY FC.GRUPO_CODIGO, FC.FRANQUIA_CODIGO')
    Left = 354
    Top = 969
    object StringField3: TStringField
      FieldKind = fkCalculated
      FieldName = 'Impressao'
      Size = 50
      Calculated = True
    end
    object qryPostosVALGUIAS: TBCDField
      FieldName = 'VALGUIAS'
      ReadOnly = True
      currency = True
      Precision = 30
      Size = 19
    end
    object qryPostosGRUPO_CODIGO: TIntegerField
      FieldName = 'GRUPO_CODIGO'
    end
    object qryPostosCOMISSAO_PERIODO: TStringField
      FieldName = 'COMISSAO_PERIODO'
      FixedChar = True
      Size = 5
    end
    object qryPostosFRANQUIA_CODIGO: TIntegerField
      FieldName = 'FRANQUIA_CODIGO'
    end
    object qryPostosGUIAS: TIntegerField
      FieldName = 'GUIAS'
      DisplayFormat = '###,###,###'
    end
    object qryPostosMEDIA: TBCDField
      FieldName = 'MEDIA'
      currency = True
      Precision = 19
      Size = 19
    end
    object qryPostosCARTA_DATAINI: TDateTimeField
      FieldName = 'CARTA_DATAINI'
    end
    object qryPostosCARTA_DATAFIM: TDateTimeField
      FieldName = 'CARTA_DATAFIM'
    end
    object qryPostosCARTA_GERACAO: TDateTimeField
      FieldName = 'CARTA_GERACAO'
    end
    object qryPostosCARTA_CREDITO: TDateTimeField
      FieldName = 'CARTA_CREDITO'
    end
    object qryPostosCARTA_OBS: TMemoField
      FieldName = 'CARTA_OBS'
      BlobType = ftMemo
    end
    object qryPostosCOMISSAO_NDEPOSITAR: TStringField
      FieldName = 'COMISSAO_NDEPOSITAR'
      FixedChar = True
      Size = 1
    end
    object qryPostosCOMISSAO_AJUSTES: TBCDField
      FieldName = 'COMISSAO_AJUSTES'
      Precision = 19
    end
    object qryPostosCOMISSAO_GARANTIA: TBCDField
      FieldName = 'COMISSAO_GARANTIA'
      Precision = 19
    end
    object qryPostosCOMISSAO_ISS: TBCDField
      FieldName = 'COMISSAO_ISS'
      Precision = 19
    end
    object qryPostosCARTA_PAGO: TBooleanField
      FieldName = 'CARTA_PAGO'
    end
    object qryPostosFRANQUIA: TStringField
      FieldName = 'FRANQUIA'
      ReadOnly = True
      Size = 63
    end
  end
  object dsAjustes: TDataSource
    DataSet = qryAjustes
    Left = 402
    Top = 951
  end
  object qryAjustes: TADOQuery
    Connection = FormPrincipal.cnRGT
    CursorType = ctStatic
    CommandTimeout = 90
    DataSource = dsConsulta
    Parameters = <
      item
        Name = 'GRUPO_CODIGO'
        Attributes = [paSigned]
        DataType = ftInteger
        Precision = 10
        Size = 4
        Value = 4000
      end
      item
        Name = 'COMISSAO_PERIODO'
        DataType = ftString
        NumericScale = 255
        Precision = 255
        Size = 5
        Value = 'MAR06'
      end>
    Prepared = True
    SQL.Strings = (
      'SELECT * FROM AJUSTECOMISSAO'
      'WHERE (GRUPO_CODIGO=:GRUPO_CODIGO)'
      'AND (COMISSAO_PERIODO=:COMISSAO_PERIODO) '
      'AND (AJUSTECOMISSAO_CREDITO = 0)')
    Left = 402
    Top = 961
    object qryAjustesGRUPO_CODIGO: TIntegerField
      FieldName = 'GRUPO_CODIGO'
    end
    object qryAjustesCOMISSAO_PERIODO: TStringField
      FieldName = 'COMISSAO_PERIODO'
      FixedChar = True
      Size = 5
    end
    object qryAjustesAJUSTEGRUPO_DESCRICAO: TStringField
      FieldName = 'AJUSTEGRUPO_DESCRICAO'
      Size = 30
    end
    object qryAjustesAJUSTECOMISSAO_VALOR: TBCDField
      FieldName = 'AJUSTECOMISSAO_VALOR'
      DisplayFormat = '###,###,##0.00'
      Precision = 19
    end
  end
  object z: TRLRichFilter
    DisplayName = 'Formato RichText'
    Left = 568
    Top = 958
  end
  object ADOQuery1: TADOQuery
    Connection = FormPrincipal.cnRGT
    CursorType = ctStatic
    CommandTimeout = 90
    Parameters = <
      item
        Name = 'PERIODO'
        DataType = ftString
        NumericScale = 255
        Precision = 255
        Size = 5
        Value = 'MAR06'
      end>
    Prepared = True
    SQL.Strings = (
      'SELECT B.NOME AS BANCO, C.*, A.CARTA_DATAINI, A.CARTA_DATAFIM, '
      'CARTA_GERACAO, CARTA_CREDITO, CARTA_OBS, CARTA_AVISO, CARTA_PAGO'
      
        'FROM CARTA A INNER JOIN COMISSAO C ON (C.COMISSAO_PERIODO=A.COMI' +
        'SSAO_PERIODO)'
      'LEFT JOIN BANCOS B ON (B.CODIGO=C.COMISSAO_BANCO)'
      'WHERE A.COMISSAO_PERIODO=:PERIODO'
      'AND ((SELECT SUM(GUIAS)'
      'FROM FRANCOMISSAO F '
      'WHERE (F.GRUPO_CODIGO=C.GRUPO_CODIGO)'
      'AND (F.COMISSAO_PERIODO=C.COMISSAO_PERIODO))>0)'
      'ORDER BY C.GRUPO_CODIGO')
    Left = 266
    Top = 311
    object StringField1: TStringField
      FieldName = 'BANCO'
      Size = 50
    end
    object IntegerField1: TIntegerField
      FieldName = 'GRUPO_CODIGO'
    end
    object StringField2: TStringField
      FieldName = 'COMISSAO_PERIODO'
      EditMask = 'AAA\/99;0; '
      FixedChar = True
      Size = 5
    end
    object BCDField1: TBCDField
      FieldName = 'GRUPO_CREDIGI'
      DisplayFormat = '##0.00%'
      Precision = 19
    end
    object IntegerField2: TIntegerField
      FieldName = 'CALGUIA_CODIGO'
    end
    object StringField4: TStringField
      FieldName = 'COMISSAO_JUNTAR'
      FixedChar = True
      Size = 1
    end
    object SmallintField1: TSmallintField
      FieldName = 'COMISSAO_BANCO'
    end
    object StringField5: TStringField
      FieldName = 'COMISSAO_AGENCIA'
      FixedChar = True
      Size = 8
    end
    object StringField6: TStringField
      FieldName = 'COMISSAO_CONTA'
      Size = 15
    end
    object StringField7: TStringField
      FieldName = 'COMISSAO_TITULAR'
      Size = 50
    end
    object BCDField2: TBCDField
      FieldName = 'COMISSAO_GARANTIA'
      Precision = 19
    end
    object BCDField3: TBCDField
      FieldName = 'COMISSAO_ISS'
      EditFormat = ' - ##0.00%'
      Precision = 19
    end
    object MemoField1: TMemoField
      FieldName = 'COMISSAO_OBS'
      BlobType = ftMemo
    end
    object StringField8: TStringField
      FieldName = 'GRUPO_ATT'
      Size = 30
    end
    object StringField9: TStringField
      FieldName = 'GRUPO_DESCRICAO'
      Size = 50
    end
    object StringField10: TStringField
      FieldName = 'GRUPO_TIPOCONTA'
      Size = 15
    end
    object BCDField4: TBCDField
      FieldName = 'GRUPO_OI'
      DisplayFormat = '##0.00%'
      Precision = 19
    end
    object BCDField5: TBCDField
      FieldName = 'GRUPO_TIM'
      DisplayFormat = '##0.00%'
      Precision = 19
    end
    object BCDField6: TBCDField
      FieldName = 'COMISSAO_AJUSTES'
      Precision = 19
    end
    object DateTimeField1: TDateTimeField
      FieldName = 'CARTA_DATAINI'
    end
    object DateTimeField2: TDateTimeField
      FieldName = 'CARTA_DATAFIM'
    end
    object DateTimeField3: TDateTimeField
      FieldName = 'CARTA_GERACAO'
    end
    object DateTimeField4: TDateTimeField
      FieldName = 'CARTA_CREDITO'
    end
    object MemoField2: TMemoField
      FieldName = 'CARTA_OBS'
      BlobType = ftFmtMemo
    end
    object MemoField3: TMemoField
      FieldName = 'CARTA_AVISO'
      BlobType = ftFmtMemo
    end
    object StringField11: TStringField
      FieldKind = fkCalculated
      FieldName = 'Impressao'
      Size = 50
      Calculated = True
    end
    object StringField12: TStringField
      FieldName = 'COMISSAO_NDEPOSITAR'
      FixedChar = True
      Size = 1
    end
    object BCDField7: TBCDField
      FieldName = 'GRUPO_EMBRATELLDR'
      DisplayFormat = '##0.00%'
      Precision = 19
    end
    object BCDField8: TBCDField
      FieldName = 'GRUPO_EMBRATELLIVRE'
      DisplayFormat = '##0.00%'
      Precision = 19
    end
    object BCDField9: TBCDField
      FieldName = 'COMISSAO_OIRECARGA'
      Precision = 19
    end
  end
  object DataSource1: TDataSource
    DataSet = ADOQuery1
    Left = 266
    Top = 328
  end
  object DataSource2: TDataSource
    DataSet = ADOQuery2
    Left = 338
    Top = 303
  end
  object ADOQuery2: TADOQuery
    Connection = FormPrincipal.cnRGT
    CursorType = ctStatic
    CommandTimeout = 90
    DataSource = DataSource1
    Parameters = <
      item
        Name = 'GRUPO_CODIGO'
        Attributes = [paSigned]
        DataType = ftInteger
        Precision = 10
        Size = 4
        Value = 4000
      end
      item
        Name = 'COMISSAO_PERIODO'
        DataType = ftString
        NumericScale = 255
        Precision = 255
        Size = 5
        Value = 'MAR06'
      end>
    Prepared = True
    SQL.Strings = (
      
        'SELECT MEDIA*GUIAS AS VALGUIAS, FC.*,  C.COMISSAO_NDEPOSITAR, C.' +
        'COMISSAO_AJUSTES,'
      
        'C.COMISSAO_GARANTIA, C.COMISSAO_ISS, A.CARTA_DATAINI, A.CARTA_DA' +
        'TAFIM,'
      
        'CARTA_GERACAO, CARTA_CREDITO, ISNULL(CARTA_OBS,'#39#39') as CARTA_OBS,' +
        ' CARTA_PAGO, '
      
        'CAST(F.CODIGO AS VARCHAR(10)) +'#39' - '#39'+F.NOME_FANTASIA AS FRANQUIA' +
        ' '
      
        'FROM CARTA A INNER JOIN COMISSAO C ON (C.COMISSAO_PERIODO=A.COMI' +
        'SSAO_PERIODO)'
      'INNER JOIN FRANCOMISSAO FC ON (FC.GRUPO_CODIGO=C.GRUPO_CODIGO)'
      'AND (FC.COMISSAO_PERIODO=C.COMISSAO_PERIODO)'
      'INNER JOIN FRANQUIA F ON (F.CODIGO=FC.FRANQUIA_CODIGO)'
      'WHERE (FC.GRUPO_CODIGO=:GRUPO_CODIGO) AND '
      ' (A.COMISSAO_PERIODO=:COMISSAO_PERIODO)  AND (GUIAS > 0)'
      'ORDER BY FC.GRUPO_CODIGO, FC.FRANQUIA_CODIGO')
    Left = 354
    Top = 321
    object StringField13: TStringField
      FieldKind = fkCalculated
      FieldName = 'Impressao'
      Size = 50
      Calculated = True
    end
    object BCDField10: TBCDField
      FieldName = 'VALGUIAS'
      ReadOnly = True
      currency = True
      Precision = 30
      Size = 19
    end
    object IntegerField3: TIntegerField
      FieldName = 'GRUPO_CODIGO'
    end
    object StringField14: TStringField
      FieldName = 'COMISSAO_PERIODO'
      FixedChar = True
      Size = 5
    end
    object IntegerField4: TIntegerField
      FieldName = 'FRANQUIA_CODIGO'
    end
    object IntegerField5: TIntegerField
      FieldName = 'GUIAS'
      DisplayFormat = '###,###,###'
    end
    object BCDField11: TBCDField
      FieldName = 'MEDIA'
      currency = True
      Precision = 19
      Size = 19
    end
    object DateTimeField5: TDateTimeField
      FieldName = 'CARTA_DATAINI'
    end
    object DateTimeField6: TDateTimeField
      FieldName = 'CARTA_DATAFIM'
    end
    object DateTimeField7: TDateTimeField
      FieldName = 'CARTA_GERACAO'
    end
    object DateTimeField8: TDateTimeField
      FieldName = 'CARTA_CREDITO'
    end
    object MemoField4: TMemoField
      FieldName = 'CARTA_OBS'
      BlobType = ftMemo
    end
    object StringField15: TStringField
      FieldName = 'COMISSAO_NDEPOSITAR'
      FixedChar = True
      Size = 1
    end
    object BCDField12: TBCDField
      FieldName = 'COMISSAO_AJUSTES'
      Precision = 19
    end
    object BCDField13: TBCDField
      FieldName = 'COMISSAO_GARANTIA'
      Precision = 19
    end
    object BCDField14: TBCDField
      FieldName = 'COMISSAO_ISS'
      Precision = 19
    end
    object BooleanField1: TBooleanField
      FieldName = 'CARTA_PAGO'
    end
    object StringField16: TStringField
      FieldName = 'FRANQUIA'
      ReadOnly = True
      Size = 63
    end
  end
  object DataSource3: TDataSource
    DataSet = ADOQuery3
    Left = 402
    Top = 303
  end
  object ADOQuery3: TADOQuery
    Connection = FormPrincipal.cnRGT
    CursorType = ctStatic
    CommandTimeout = 90
    DataSource = DataSource1
    Parameters = <
      item
        Name = 'GRUPO_CODIGO'
        Attributes = [paSigned]
        DataType = ftInteger
        Precision = 10
        Size = 4
        Value = 4000
      end
      item
        Name = 'COMISSAO_PERIODO'
        DataType = ftString
        NumericScale = 255
        Precision = 255
        Size = 5
        Value = 'MAR06'
      end>
    Prepared = True
    SQL.Strings = (
      'SELECT * FROM AJUSTECOMISSAO'
      'WHERE (GRUPO_CODIGO=:GRUPO_CODIGO)'
      'AND (COMISSAO_PERIODO=:COMISSAO_PERIODO) '
      'AND (AJUSTECOMISSAO_CREDITO = 0)')
    Left = 402
    Top = 313
    object IntegerField6: TIntegerField
      FieldName = 'GRUPO_CODIGO'
    end
    object StringField17: TStringField
      FieldName = 'COMISSAO_PERIODO'
      FixedChar = True
      Size = 5
    end
    object StringField18: TStringField
      FieldName = 'AJUSTEGRUPO_DESCRICAO'
      Size = 30
    end
    object BCDField15: TBCDField
      FieldName = 'AJUSTECOMISSAO_VALOR'
      DisplayFormat = '###,###,##0.00'
      Precision = 19
    end
  end
  object RLRichFilter1: TRLRichFilter
    DisplayName = 'Formato RichText'
    Left = 568
    Top = 310
  end
end
